package edu.kaist.cs442.client.android.myactivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import edu.kaist.cs442.client.android.R;
import edu.kaist.cs442.client.android.common.location.track.TrackService;
import edu.kaist.cs442.client.android.common.pushutil.broadcast.Broadcast;
import edu.kaist.cs442.client.android.common.pushutil.register.Register;
import edu.kaist.cs442.client.android.common.pushutil.send.Send;

public class MyActivity extends Activity {
	/**
	 * Called when the ctivity is first created.
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		findViewById(R.id.registerBN).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View view) {
				new Register().execute(view.getContext());
			}
		});

		findViewById(R.id.trymeBN).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View view) {
				new Send().execute(view.getContext());
			}
		});
		findViewById(R.id.updateBN).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View view) {
				view.getContext().startService(new Intent(view.getContext(), TrackService.class));
			}
		});

		findViewById(R.id.broadcastBN).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View view) {
				new Broadcast().execute(view.getContext());
			}
		});
	}


}